'''
Created on 2010-12-12

@author: Administrator
'''

import wx
from wx.py.shell import ShellFrame
from wx.py.filling import FillingFrame
import images

class ToolbarFrame(wx.Frame):
  def __init__(self, parent, id):
    wx.Frame.__init__(self, parent, id, 'Tool Bar', size=(300,200))
    panel = wx.Panel(self, -1)
    panel.SetBackgroundColour('White')
    statusBar = self.CreateStatusBar()
    toolBar = self.CreateToolBar()
    toolBar.AddSimpleTool(wx.NewId(), images.getPyBitmap(), "New", 
                          "Long help for 'New'")
    toolBar.Realize()
    
    menuBar = wx.MenuBar()
    menu1 = wx.Menu()
    exit = menu1.Append(wx.NewId(), "&Exit", "Exit Application")
    menuBar.Append(menu1, "&File")
    self.Bind(wx.EVT_MENU, self.OnCloseMe, exit)
    
    menu2 = wx.Menu()
    menu2.Append(wx.NewId(), "Copy", "Copy in Status bar")
    menu2.Append(wx.NewId(), "Cut", "Cut in Status bar")
    menu2.Append(wx.NewId(), "Paste", "Paste Somthing")
    menu2.AppendSeparator()
    menu2.Append(wx.NewId(), "Options", "Display ...")
    menuBar.Append(menu2, "Edit")
    
    menu3 = wx.Menu()
    shell = menu3.Append(-1, "Shell", "Open wxPython Shell Frame")
    filling = menu3.Append(-1, "Filling", "Open wxPython Filling Frame")
    
    menuBar.Append(menu3, "Setting")
    
    self.SetMenuBar(menuBar)
    
    self.Bind(wx.EVT_MENU, self.OnShell, shell)
    self.Bind(wx.EVT_MENU, self.OnFilling, filling)
    
  def OnCloseMe(self, event):
    self.Close()
  
  def OnCloseWindow(self, event):
    self.Destroy()
    
  def OnShell(self, event):
    frame = ShellFrame(parent=self)
    frame.Show()
    
  def OnFilling(self, event):
    frame = FillingFrame(parent=self)
    frame.Show()


if __name__ == '__main__':
  app = wx.PySimpleApp()
  app.frame = ToolbarFrame(parent=None, id=-1)
  app.frame.Show()
  app.MainLoop()